package com.wan37.logic.chat.domain.vo;

import com.wan37.logic.chat.domain.entity.PrivateChatDO;
import com.wan37.logic.chat.domain.entity.WorldChatDO;

import javax.swing.*;

/**
 * @author : luoyong
 * @date : 2020-07-15 10:36
 **/
public class ChatVO {
    private String senderId;
    private String content;
    private long createTime;

    public ChatVO() {
    }

    public ChatVO(String senderId, String content) {
        this.senderId = senderId;
        this.content = content;
        this.createTime = System.currentTimeMillis();
    }

    public ChatVO(WorldChatDO worldChatDO) {
        this.senderId = worldChatDO.getUserId();
        this.content = worldChatDO.getContent();
        this.createTime = worldChatDO.getCreateTime();
    }
    public ChatVO(PrivateChatDO privateChatDO){
        this.senderId = privateChatDO.getSenderId();
        this.content = privateChatDO.getContent();
        this.createTime = privateChatDO.getCreateTime();
    }

    public String getSenderId() {
        return senderId;
    }

    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public long getCreateTime() {
        return createTime;
    }
}
